✨ server: expose unknown decline reasons - #1275
Conversation
🦋 Changeset detectedLatest commit: a8e7a26 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Team Run ID: 📒 Files selected for processing (6)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. WalkthroughThe change preserves unknown Panda decline reasons, filters requested bodies by declined status, reports unmatched created-action reasons to Sentry, updates activity and worker handling, and adds a patch changeset for ChangesPanda decline reason handling
Estimated code review effort: 3 (Moderate) | ~25 minutes Merge Risk: 🔵 Low · up to The PR exposes normalized or preserved provider decline reasons in authenticated activity responses. It is mergeable with owner awareness because provider-originated text now has broader user-visible semantics and validation coverage is not complete across all consumers; authentication and account-data scoping are unchanged. Sequence Diagram(s)sequenceDiagram
participant PandaWebhook
participant decline
participant Sentry
participant HookWorker
participant PandaActivity
PandaWebhook->>decline: resolve raw decline reason
decline-->>PandaWebhook: mapped message or raw reason
PandaWebhook->>Sentry: capture unmatched created-action reason
PandaWebhook->>HookWorker: store declined webhook payload
HookWorker->>decline: check stored reason match
HookWorker->>PandaActivity: deliver declined reason
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
b1ff0e6 to
3cf7341
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b1ff0e642c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1275 +/- ##
==========================================
+ Coverage 72.51% 74.06% +1.54%
==========================================
Files 275 276 +1
Lines 13256 13616 +360
Branches 4607 4883 +276
==========================================
+ Hits 9613 10085 +472
+ Misses 3306 3214 -92
+ Partials 337 317 -20
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
3cf7341 to
5be6d15
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5be6d15438
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
5be6d15 to
ac5a21a
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ac5a21acae
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
ac5a21a to
4be8649
Compare
4be8649 to
cd097f5
Compare
cd097f5 to
2260dba
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 94f45d056e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
2615692 to
d250c14
Compare
d250c14 to
a0f3627
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a0f3627148
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
a0f3627 to
fd05018
Compare
fd05018 to
638fd26
Compare
638fd26 to
ebbbf9b
Compare
ebbbf9b to
0177b81
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0177b81587
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| reason: declineMessage(declinedReason) ?? body.reason ?? "transaction declined", | ||
| reason: | ||
| declineMessage(declinedReason) ?? | ||
| body.reason ?? |
There was a problem hiding this comment.
Prefer direct provider reasons over legacy stored reasons
When a declined body contains both an unmapped nested provider reason and a legacy top-level reason, this fallback selects body.reason first, so a stale value such as "transaction declined" still hides the new provider reason. The activity tests already establish that these fields can coexist for mapped reasons; preserve the same nested-field precedence for unknown direct provider reasons and cover this combined fallback. .agents/rules/server.mdL73-L73
Useful? React with 👍 / 👎.
| reason: | ||
| declineMessage(declinedReason) ?? | ||
| body.reason ?? | ||
| (declinedReason && declinedReason !== "webhook declined" ? declinedReason : "transaction declined"), |
There was a problem hiding this comment.
Hide unmapped requested reasons in activity output
When Panda reports "webhook declined" and the saved declined request contains an unmapped local reason such as "high risk", lines 527–530 assign that local value to declinedReason, and this new fallback exposes it through the activity API. Fresh evidence since the earlier rebuttal is this commit's requested === undefined notification guard and worker expectation that mask this exact requested-reason case; retain the raw fallback only when it came directly from the provider. .agents/rules/server.mdL73-L73
Useful? React with 👍 / 👎.
0177b81 to
a8e7a26
Compare
Summary by CodeRabbit
New Features
Bug Fixes
Tests